package cn.itcast.mapper;

import cn.itcast.domain.Course;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CourseMapper {
    @Select("select * from st_course")
    List<Course> findAll();

    @Insert("insert into st_course(id,name,state,remark,create_time) values(#{id},#{name},#{state},#{remark},#{createTime})")
    void add(Course course);

    @Select("select * from st_course where id = #{id}")
    Course findById(String id);

    @Update("update st_course set name=#{name},remark=#{remark},state=#{state} where id = #{id} ")
    void edit(Course course);

    void deleteByIds(String[] sts);
    @Select("select * from st_course where id = #{id}")
    Course findByCid(String id);
}
